//  Symbol()表示独一无二的值
//  ===表示严格意义上的相等
{
    //  声明
    let a1 = Symbol();
    let a2 = Symbol();
    console.log(a1 === a2);
    console.log(typeof a1);

    //  a4获取的是a3的值
    let a3 = Symbol.for('a3');
    let a4 = Symbol.for('a3');
    console.log(a3 === a4);
}

{
    //  Symbol作为属性名
    let a1 = Symbol.for('abc');
    let obj = {
        [a1]: '123',
        'abc': 345,
        'c': 456
    }
    console.log('obj', obj);

    //  取不到Symbol属性名的值
    for (let [key, value] of Object.entries(obj)) {
        console.log(key, value)
    }

    //  Object.getOwnPropertySymbols获取带有Symbol属性名的值，返回值为数组
    Object.getOwnPropertySymbols(obj).forEach(item => console.log(obj[item]));

    //  Reflect.ownKeys获取所有属性的值
    Reflect.ownKeys(obj).forEach(item => console.log('ownkeys', item, obj[item]));
}